package cn.t222.ch04.config;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Set;

@Component
public class MyApplicationRunner1 implements ApplicationRunner {
    @Override
    public void run(ApplicationArguments args) throws Exception {
        List<String> nonOptionArgs = args.getNonOptionArgs();
        System.out.println(nonOptionArgs);
        Set<String> set = args.getOptionNames();
        set.forEach(s -> {
            System.out.println(s + "---" + args.getOptionValues(s));
        });
    }
}
